import {
  _id,
  _price,
  _times,
  _company,
  _boolean,
  _fullName,
  _taskNames,
  _postTitles,
  _description,
  _productNames,
  _envDatas,
  _docDatas, _projectDatas,
} from './_mock';

// ----------------------------------------------------------------------

export const _myAccount = {
  displayName: 'tan',
  email: 'demo@qq.com',
  photoURL: '/assets/images/avatar/avatar-25.webp',
};

// ----------------------------------------------------------------------

export const _users = [...Array(24)].map((_, index) => ({
  id: _id(index),
  name: _fullName(index),
  company: _company(index),
  isVerified: _boolean(index),
  avatarUrl: `/assets/images/avatar/avatar-${index + 1}.webp`,
  status: index % 4 ? 'active' : 'banned',
  role:
    [
      'Leader',
      'Hr Manager',
      'UI Designer',
      'UX Designer',
      'UI/UX Designer',
      'Project Manager',
      'Backend Developer',
      'Full Stack Designer',
      'Front End Developer',
      'Full Stack Developer',
    ][index] || 'UI Designer',
}));



export const _envs = [...Array(5)].map((_, index) => ({
  id: _id(index),
  name: _envDatas(index).name,
  version: _envDatas(index).version,
  path: _envDatas(index).path,
  avatarUrl: `/assets/images/avatar/avatar-${index + 1}.webp`,
  status: _envDatas(index).status
}));


// ----------------------------------------------------------------------

export const _posts = [...Array(23)].map((_, index) => ({
  id: _id(index),
  title: _postTitles(index),
  description: _description(index),
  coverUrl: `/assets/images/cover/cover-${index + 1}.webp`,
  totalViews: 8829,
  totalComments: 7977,
  totalShares: 8556,
  totalFavorites: 8870,
  postedAt: _times(index),
  author: {
    name: _fullName(index),
    avatarUrl: `/assets/images/avatar/avatar-${index + 1}.webp`,
  },
}));

// ----------------------------------------------------------------------
export const _docs = [...Array(20)].map((_, index) => ({
  id: _id(index),
  title: _docDatas(index).title,
  description: _docDatas(index).description,
  coverUrl: _docDatas(index).coverUrl,
  totalViews: 8829,
  totalComments: 7977,
  totalShares: 8556,
  totalFavorites: 8870,
  postedAt:  _docDatas(index).postedAt,
  author: {
    name: _fullName(index),
    avatarUrl: `/assets/images/avatar/avatar-${index + 1}.webp`,
  },
}));

// ----------------------------------------------------------------------

const COLORS = [
  '#00AB55',
  '#000000',
  '#FFFFFF',
  '#FFC0CB',
  '#FF4842',
  '#1890FF',
  '#94D82D',
  '#FFC107',
];

export const _products = [...Array(10)].map((_, index) => {
  const setIndex = index + 1;

  return {
    id: _id(index),
    name: _projectDatas(index).name,
    type: _projectDatas(index).type,
    coverUrl: _projectDatas(index).coverUrl,
    colors:
      (setIndex === 1 && COLORS.slice(0, 2)) ||
      (setIndex === 2 && COLORS.slice(1, 3)) ||
      (setIndex === 3 && COLORS.slice(2, 4)) ||
      (setIndex === 4 && COLORS.slice(3, 6)) ||
      (setIndex === 23 && COLORS.slice(4, 6)) ||
      (setIndex === 24 && COLORS.slice(5, 6)) ||
      COLORS,
    status:_projectDatas(index).status,
  };
});

// ----------------------------------------------------------------------

export const _langs = [
  {
    value: 'zh-CN',
    label: 'Chinese',
    icon: '/assets/icons/flags/ic-flag-cn.svg',
  },
  {
    value: 'en',
    label: 'English',
    icon: '/assets/icons/flags/ic-flag-en.svg',
  }
];

// ----------------------------------------------------------------------

export const _timeline = [...Array(5)].map((_, index) => ({
  id: _id(index),
  title: [
    '1983, orders, $4220',
    '12 Invoices have been paid',
    'Order #37745 from September',
    'New order placed #XF-2356',
    'New order placed #XF-2346',
  ][index],
  type: `order${index + 1}`,
  time: _times(index),
}));

export const _traffic = [
  {
    value: 'docker',
    label: 'Docker',
    version: 'Docker version 26.1.4, build 5650f9b',
  },
  {
    value: 'java',
    label: 'Java',
    version: 'openjdk version "17.0.10" 2024-01-16 LTS',
  },
  {
    value: 'node',
    label: 'Node',
    version: 'v20.9.0',
  },
  {
    value: 'python',
    label: 'Python',
    version: 'Python 3.12.2',
  },
  {
    value: 'maven',
    label: 'Maven',
    version: 'Apache Maven 3.6.3',
  },
];

export const _tasks = Array.from({ length: 5 }, (_, index) => ({
  id: _id(index),
  name: _taskNames(index),
}));

// ----------------------------------------------------------------------

export const _notifications = [
  {
    id: _id(1),
    title: '项目上线',
    description: '发布0.0.1版本',
    avatarUrl: null,
    type: 'order-placed',
    postedAt: _times(1),
    isUnRead: true,
  },
  {
    id: _id(2),
    title: _fullName(2),
    description: '评论了项目部署错误问题',
    avatarUrl: '/assets/images/avatar/avatar-2.webp',
    type: 'friend-interactive',
    postedAt: _times(2),
    isUnRead: true,
  },
  {
    id: _id(3),
    title: '新消息',
    description: '5条未读消息',
    avatarUrl: null,
    type: 'chat-message',
    postedAt: _times(3),
    isUnRead: false,
  },
  {
    id: _id(4),
    title: '邮件通知',
    description: 'xx发来的邮件',
    avatarUrl: null,
    type: 'mail',
    postedAt: _times(4),
    isUnRead: false,
  },
  {
    id: _id(5),
    title: '部署',
    description: 'xx项目正在部署',
    avatarUrl: null,
    type: 'order-shipped',
    postedAt: _times(5),
    isUnRead: false,
  },
];
